home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 April / april_2001.iso / intercd / root / Html / ^CoffeeCup_Html / setup.exe / %MAINDIR% / cgi-bin / search / search.txt < prev   
Encoding:
Text File  |  2001-02-20  |  7.1 KB  |  146 lines

  1. This is the Readme.txt to help you.  The actual CGI script is the file named:
  2. 'search.pl'.
  3.  
  4. ##############################################################################
  5. # Simple Search                 Version 1.0                                  #
  6. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
  7. # Created 12/16/95              Last Modified 12/16/95                       #
  8. # Scripts Archive at:           http://www.scriptarchive.com                 #
  9. ##############################################################################
  10. # If you run into any problems while trying to configure this scripts, help
  11. # is available.  The steps you should take to get the fastest results, are:
  12. #    1) Read this file thoroughly
  13. #    2) Consult the Matt's Script Archive Frequently Asked Questions if you
  14. #    are having any problems:
  15. #        http://www.worldwidemart.com/scripts/faq/
  16. #
  17. # Hopefully we will be able to help you solve your problems.  Thank you.
  18. ##############################################################################
  19. # COPYRIGHT NOTICE                                                           #
  20. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  21. #                                                                            #
  22. # Simple Search may be used and modified free of charge by anyone so long as #
  23. # this copyright notice and the comments above remain intact.  By using this #
  24. # code you agree to indemnify Matthew M. Wright and CoffeeCup Software from  #  
  25. # any liability that might arise from it's use.                              #  
  26. #                                                                            #
  27. # Selling the code for this program without prior written consent is         #
  28. # expressly forbidden.  In other words, please ask first before you try and  #
  29. # make money off of my program.                                              #
  30. #                                                                            #
  31. # Obtain permission before redistributing this software over the Internet or #
  32. # in any other medium.  In all cases copyright and header must remain intact.#
  33. ##############################################################################
  34.  
  35.     The simple search script was written to allow people to set up a 
  36. search of their site, so their users could enter keywords and find all 
  37. documents matching those keywords.  It was written to be simple, so there 
  38. are not many options.  When the search returns pages, it returns them in 
  39. no real order, and they are referenced with the <title> tag of that page.
  40.  
  41.     The instructions below explain how to set up and configure the 
  42. Simple Search script.  The script should have come with three files:
  43.  
  44.     1) README.TXT     - Useful installation instructions.
  45.     2) search.pl     - The Perl script which does the searching.
  46.     3) search.html  - A sample HTML Search Page.
  47.  
  48. SEARCH.PL
  49. =========
  50.  
  51.     This script is the one that you will need to define what files 
  52. you want to be searched and the locations of those files.  First you need 
  53. to define the variables:
  54.  
  55.     $basedir = '';
  56.         This is the base directory to the files you will want to 
  57.        search.  If you have all of your files in /home/joe/public_html
  58.        and you want to search files that are in 
  59.        /home/joe/public_html/work and /home/joe/public_html/fun, then
  60.        you would set your base directory at /home/joe/public_html/ and
  61.        then put subdirectories into the @files array, since they will be 
  62.        put together at run time.  The $basedir variable just saves you the 
  63.        time of having to type out the basedir over and over again for 
  64.        every file you want to include.
  65.  
  66.     $baseurl = '';
  67.         This is very similar to the basedir variable except that 
  68.        it will be used as a base reference to the files you want to search
  69.        in terms of the web.  For the example above with user joe, his 
  70.        baseurl would probably be something like: http://joe.host.com/~joe/ 
  71.        so that when the searched files are appended to this baseurl, they 
  72.        form a complete url to his files to place in the results.
  73.  
  74.     @files = ();
  75.         This is an array that includes all of the files you want 
  76.        to search.  The directory paths and filenames should be in 
  77.        reference to $basedir.  Wild cards are allowed in this array, so if 
  78.        joe wanted to search all html files in fun/ and work/, he would set 
  79.        his @files array up as: @files = ('fun/*.html','work/*.html');  You 
  80.        can also search whole directories at one time, like: @files = 
  81.        ('fun/','work/');  This would search all text files located in these 
  82.        directories.  Putting exact filenames will search only that filename.
  83.  
  84.     $title = "";
  85.         This variable is used to display the title of your page 
  86.        in the search results and used to link back to your main page.
  87.  
  88.     $title_url = '';
  89.         This is the url that would link to the page $title.
  90.  
  91.     $search_url = '';
  92.         This is the url to the search.html page you set up, so 
  93.        that it can be referenced from in the results page if users want
  94.        to make another search.
  95.  
  96.     That is all of the variables that need to be configured in your 
  97. script.  You must also chmod this script to 755 so that all users can 
  98. execute it and place it in your cgi-bin or change the name to 
  99. search.cgi.  Now you simply have to edit the search.html page and you are 
  100. ready to go!
  101. ------------------------------------------------------------------------------
  102.  
  103. SEARCH.HTML
  104. ===========
  105.  
  106.     This page needs only a little changing.  You will probably want 
  107. to change the title and header of this page to match your site, and you 
  108. may want to change the background and other features of it to make it fit 
  109. into your site better.
  110.  
  111.     The main thing you will need to change is the action="" of your 
  112. script from the fake url, to the url of your search.pl script.  Once you 
  113. have changed this, and have implemented the changes listed above in 
  114. search.pl, the search program should work.
  115.  
  116.     search.html should be chmoded 744 so that it is readable by everyone.
  117. ------------------------------------------------------------------------------
  118.  
  119. README
  120. ======
  121.  
  122.     Just read it!
  123. ------------------------------------------------------------------------------
  124.  
  125.     If you have any questions about setting up or implementing this 
  126. script feel free to mail me at the address at the top of this file AFTER 
  127. you have read the Frequently Asked Questions located at:
  128.  
  129.     http://www.worldwidemart.com/scripts/faq/
  130.  
  131. ------------------------------------------------------------------------------
  132.  
  133. Feel free to change/hack/modify whatever this script, but please leave 
  134. my name and url in it at all times.  If you end up implementing this 
  135. script on a page, please let me know by filling out the form located at:
  136.  
  137.     http://www.worldwidemart.com/scripts/implement.html
  138.  
  139. Feel free to link back to my site at the bottom of your page if you enjoy 
  140. these scripts and use them, although it is not required.  And most of all 
  141. Have fun!
  142.  
  143. ------------------------------------------------------------------------------
  144. Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
  145.  
  146.